﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using Domaine;
using Persistance.ViewModel;

namespace WebServices
{
    [ServiceContract(Namespace = "")]
    interface IExaPlanningService
    {
        #region LogIn
        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        CollaboratorViewModel LogInJSON(string login, string password);

        [OperationContract]
        CollaboratorViewModel LogIn();
        #endregion

        #region GetCalendarYear

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        CalendarYear GetCalendarYearJSON(string login, string password, int year);

        [OperationContract]
        CalendarYear GetCalendarYear(int year);
        #endregion

        #region GetCalendarMonth

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        CalendarMonth GetCalendarMonthJSON(string login, string password, int year, int month);

        [OperationContract]
        CalendarMonth GetCalendarMonth(int year, int month);
        #endregion

        #region GetCalendarWeek

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        CalendarWeek GetCalendarWeekJSON(string login, string password, int fyear, int fmonth, int fday, int lyear, int lmonth, int lday);

        [OperationContract]
        CalendarWeek GetCalendarWeek(int fyear, int fmonth, int fday, int lyear, int lmonth, int lday);
        #endregion

        #region GetProjectCalendarYear

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        CalendarYear GetProjectCalendarYearJSON(string login, string password, int year, string reference);

        [OperationContract]
        CalendarYear GetProjectCalendarYear(int year, string reference);
        #endregion

        #region GetProjectCalendarMonth

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        CalendarMonth GetProjectCalendarMonthJSON(string login, string password, int year, int month, string reference);

        [OperationContract]
        CalendarMonth GetProjectCalendarMonth(int year, int month, string reference);
        #endregion

        #region GetProjectCalendarWeek

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        CalendarWeek GetProjectCalendarWeekJSON(string login, string password, int fyear, int fmonth, int fday, int lyear, int lmonth, int lday, string reference);

        [OperationContract]
        CalendarWeek GetProjectCalendarWeek(int fyear, int fmonth, int fday, int lyear, int lmonth, int lday, string reference);
        #endregion

        #region GetAllProjectForYear

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        List<ProjectFullDetailModel> GetAllProjectForYearJSON(string login, string password, int year);

        [OperationContract]
        List<ProjectFullDetailModel> GetAllProjectForYear(int year);
        #endregion

        #region GetProject

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ProjectFullDetailModel GetProjectJSON(string login, string password, string reference);

        [OperationContract]
        ProjectFullDetailModel GetProject( string reference);
        #endregion
        
        #region GetLeaderProject

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        List<LeaderProjectSimpleModel> GetLeaderProjectJSON(string login, string password, string critere);

        [OperationContract]
        List<LeaderProjectSimpleModel> GetLeaderProject(string critere);
        #endregion

        #region GetCollaborators

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        List<CollaboratorViewModel> GetCollaboratorsJSON(string login, string password, string critere);

        [OperationContract]
        List<CollaboratorViewModel> GetCollaborators(string critere);
        #endregion

        #region AddProject

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void AddProjectJSON(string login, string password, string reference, string name, DateTime beginDate, DateTime endDate, string client, string color, string loginCP);
        
        [OperationContract]
        void AddProject(string reference, string name, DateTime beginDate, DateTime endDate, string client, string color, string loginCP);
        #endregion

        #region EditProject

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void EditProjectJSON(string login,string password, string reference, string name, DateTime beginDate, DateTime endDate, int state, string client, string color);

        [OperationContract]
        void EditProject(string reference, string name, DateTime beginDate, DateTime endDate, int state, string client, string color);
        #endregion

        #region GetTeamProject

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        List<CollaboratorViewModel> GetTeamProjectJSON(string login, string password, string reference);

        [OperationContract]
        List<CollaboratorViewModel> GetTeamProject(string reference);
        #endregion

        #region AddCollabToTeamProject

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void AddCollabToTeamProjectJSON(string login, string password, string reference, string loginCollab);

        [OperationContract]
        void AddCollabToTeamProject(string reference, string loginCollab);
        #endregion

        #region RemoveCollabFromTeamProject

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void RemoveCollabFromTeamProjectJSON(string login, string password, string reference, string loginCollab);

        [OperationContract]
        void RemoveCollabFromTeamProject(string reference, string loginCollab);
        #endregion

        #region GetAllState

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        List<Persistance.ViewModel.State> GetAllStateJSON(string login, string password);

        [OperationContract]
        List<Persistance.ViewModel.State> GetAllState();
        #endregion

        #region GetAllLocation

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        List<LocationViewModel> GetAllLocationJSON();

        [OperationContract]
        List<LocationViewModel> GetAllLocation();

        #endregion

        #region GetAllActivity

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        List<ActivityViewModel> GetAllActivityJSON();

        [OperationContract]
        List<ActivityViewModel> GetAllActivity();

        #endregion

        #region GetAllJob

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        List<JobViewModel> GetAllJobJSON();

        [OperationContract]
        List<JobViewModel> GetAllJob();

        #endregion

        #region Register

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void RegisterJSON(string login, string password, string loginNewCollab, string passwordNewCollab, string name, string firstName, string mobilePhone, string email, int job, int location, int activity);
        

        [OperationContract]
        void Register(string loginNewCollab, string passwordNewCollab, string name, string firstName, string mobilePhone, string email, int job, int location, int activity);
        
        #endregion

        #region EditProfile

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void EditProfileJSON(String login, string oldPassword, string newPassword, string name, string firstName, string mobilePhone, string email, byte[] image);
        
        [OperationContract]
        void EditProfile(string newPassword, string name, string firstName, string mobilePhone, string email, byte[] image);
        
        #endregion

        #region EditCollab

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void EditCollabJSON(String login, string password, string loginCollab, int job, int activity, int location);

        [OperationContract]
        void EditCollab(string loginCollab, int job, int activity, int location);

        #endregion

        #region DeleteCollab

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void DeleteCollabJSON(string login, string password, string loginCollab);

        [OperationContract]
        void DeleteCollab( string loginCollab);

        #endregion

        #region AddTasks

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void AddTasksJSON(string login, string password, List<TaskViewModel> tasks);

        [OperationContract]
        void AddTasks(List<TaskViewModel> tasks);

        #endregion

        #region EditTask

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void EditTaskJSON(string login, string password, int idTask, TaskViewModel task);

        [OperationContract]
        void EditTask(int idTask, TaskViewModel task);

        #endregion

        #region DeleteTask

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        void DeleteTaskJSON(string login, string password, int idTask);

        [OperationContract]
        void DeleteTask(int idTask);

        #endregion

        #region GetTask

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        TaskViewModel GetTaskJSON(string login, string password, int idTask);
        
        [OperationContract]
        TaskViewModel GetTask(int idTask);
        
        #endregion

        
    }
}
